package com.cn.yds.bdy.vo;

import lombok.Data;

@Data
public class ResponseResult {

    private Integer status;

    private String message;

    private Object data;

    public static ResponseResult ok(){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(200);
        return responseResult;
    }

    public static ResponseResult ok(String message){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(200);
        responseResult.setMessage(message);
        return responseResult;
    }

    public static ResponseResult ok(Object data){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(200);
        responseResult.setData(data);
        return responseResult;
    }

    public static ResponseResult ok(String message, Object data){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(200);
        responseResult.setMessage(message);
        responseResult.setData(data);
        return responseResult;
    }

    public static ResponseResult fail(Integer status){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(status);
        return responseResult;
    }

    public static ResponseResult failBy500(){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(500);
        return responseResult;
    }

    public static ResponseResult fail(String message){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(500);
        responseResult.setMessage(message);
        return responseResult;
    }

    public static ResponseResult fail(Integer status,String message){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setStatus(status);
        responseResult.setMessage(message);
        return responseResult;
    }


}
